package hello;

import java.sql.PreparedStatement;

import javax.swing.JOptionPane;

public class HelloBussiness extends AbstractBase {
	PreparedStatement pst;
	public void insertName(String first, String last) {
		if (cn != null) {
			try {
				String sql = "insert into name(first,last) values ('"+first+"','"+last+"')";
				pst = cn.prepareStatement(sql);
				pst.executeUpdate();
				JOptionPane.showMessageDialog(null, "Insert Sussess!");
					
			} catch (Exception ex) {
				ex.printStackTrace();
				JOptionPane.showMessageDialog(null, "Insert Fail!");
			}
		}
		
	}

}
